package com.ad2campaign.engine.core;

public enum TaskStatus 
{
	READY(0,"Ready"),PICKED(1,"Picked"),RUNNING(2,"Running"),COMPLETED(3,"Completed"),PAUSED(4,"Paused"),UNKNOWN(5,"Unknown"),FAILED(6,"Failed");
	
	private int statusValue;
	private String statusString;
	
	public int getStatusValue() {
		return statusValue;
	}

	public void setStatusValue(int statusValue) {
		this.statusValue = statusValue;
	}

	public String getStatusString() {
		return statusString;
	}

	public void setStatusString(String statusString) {
		this.statusString = statusString;
	}

	TaskStatus(int statusValue,String statusString)
	{
		this.statusValue=statusValue;
		this.statusString=statusString;
	}
	
	public static TaskStatus getStatus(int status)
	{
		switch(status)
		{
			case 0 : return TaskStatus.READY;
			case 1 : return TaskStatus.PICKED;
			case 2 : return TaskStatus.RUNNING;
			case 3 : return TaskStatus.COMPLETED;
			case 4 : return TaskStatus.PAUSED;
			case 6 : return TaskStatus.FAILED;
			default : return TaskStatus.UNKNOWN;
		}
	}
	
	
}
